package pack1;

import java.awt.AWTException;
import java.awt.Robot;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.*;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Actions;

import exefiles.*;

public class sprg9 {
public static void main(String[] args) throws AWTException, InterruptedException {

	//System.setProperty("webdriver.chrome.driver", "C://Project_GoJob//Eclipse_workspace//selenium_test//src//exefiles//chromedriver.exe");
	System.setProperty("webdriver.chrome.driver","./src/exefiles/chromedriver.exe");
	WebDriver driver= new ChromeDriver();
	
	driver.get("file:///C:/Users/anand/Desktop/tst.html");
	driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
	driver.manage().window().maximize();
//String s=	driver.findElement(By.id("image")).getAttribute("src");
String s="af";
driver.findElement(By.xpath("//p[1]/input[4]")).click();
//sendKeys(Keys.RETURN);

	System.out.println(s);

	//count no of links/

	List<WebElement> all = driver.findElements(By.tagName("a"));
	int t=all.size();
	System.out.println("    "+t);
	
	List<WebElement> d = driver.findElements(By.xpath("//input[@type='checkbox']"));
	
	Actions action = new Actions(driver);
	//action.contextClick();
	WebElement src=driver.findElement(By.id("a1"));
	System.out.println("hello");
	boolean b=driver.findElement(By.name("text")).isDisplayed();
	System.out.println(b);
//	driver.switchTo().activeElement();
	WebElement dest=driver.findElement(By.name("txt"));

		action.perform();
	action.dragAndDrop(src, dest).perform();
	String ss=driver.getCurrentUrl();
Robot	robot = new Robot();
robot.mouseWheel(-2);
Thread.sleep(1000);
robot.mouseWheel(2);
Thread.sleep(1000);
robot.mouseWheel(2);
robot.mouseMove(55, 55);
System.out.println(d.size()+"   "+ss);


}
}
